import { createApp } from 'vue'
import App from './App.vue'
import router from "./router"
import axios from './request/http'
//导入全局样式表
import './assets/css/global.css'
//导入element-plus icons
import * as ELIcons from '@element-plus/icons-vue'
//导入pinia
import { createPinia } from 'pinia'
import 'element-plus/theme-chalk/src/message.scss'

// 引入全局可用阿里图标样式文件
import './assets/iconfont/iconfont.css'
// 引入全局可用阿里图标js文件
import './assets/iconfont/iconfont.js'
// 引入自己设置的全局icon基础样式，一般用于规定基础的svg宽高和图标大小
import './assets/css/iconfont.css'

import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'


//禁用后退前进按钮
window.addEventListener('popstate', function () {
	history.pushState(null, null, document.URL)
})


const app = createApp(App)
//全局挂载axios
app.config.globalProperties.$axios = axios

app.use(router)
//全局挂载element icons
for (let iconName in ELIcons) {
	app.component(iconName, ELIcons[iconName])
}
//创建pinia实例
const pinia = createPinia()
//挂载pinia实例
app.use(pinia)

//elementplus中文国际化
app.use(ElementPlus, {
  locale: zhCn,
})

app.mount("#app")



